import { Module } from '@nestjs/common';
import { VideoController } from './video.controller';
import { VideoService } from './video.service';

const mockVideoService = {
  getVideos() {
    return '我是Mock的Video';
  },
};

@Module({
  controllers: [VideoController],
  // providers: [VideoService],
  providers: [
    {
      provide: VideoService,
      // VideoService 令牌将解析为模拟对象 mockVideoService
      useValue: mockVideoService,
    },
  ],
})
export class VideoModule {}
// 值提供者：useValue
// useValue 语法适用于注入常量值、将外部库放入 Nest 容器或用模拟对象替换实际实现
